Intermix v0.8.0 Released

Intermix Version 0.8.0 introduces advanced audio routing and comes with a basic delay fx plugin.

Now plugins can be connected by a simple function call. Routing is done in realtime while intermix keeps track of the state of the audio graph.

Audio Routing

In the following example, synthOut and delayIn are audio endpoints. These are tuples that contain the plugin id and the channel number. The new connectPlugins function takes two audio endpoints as arguments - an output followed by an input:

import { addPlugin, connectPlugins } from "intermix";
const synthID = addPlugin('Synth');
const delayID = addPlugin('Delay');
// now we connect the 1st output of the synth
// to the 1st input of the delay
const synthOut = [synthID, 0];
const delayIn = [delayID, 0];
connectPlugins(synthOut, delayIn);

The delay plugin doesn't need output wiring because all plugins are connected to the soundcard by default. If you want to disconnect these plugins simply route the synth to the soundcard again:

connectPlugins(synthOut, ["destination", 0]);

The soundcard is called destination according to the audio context and has just one input. Intermix will automatically disconnect the synth from the delay and log the new state. If you want to connect a plugin to multiple inputs you have to use multiple outputs(*).

Config / Sourcemaps

I stripped the sourcemaps from the production build to get an even smaller package size (<80k). Instead, there are non-minified bundles to be used in a node environment. A minified ES2015 bundle is still included and can be embedded directly into a website via script tag. Minified CommonJS is also removed because it can't be used in the browser.

The point is that sourcemaps are pretty useless in an npm package where you don't have direct access to the unbundled sourcecode. Instead, seeing readable, uncompressed production-code in the debugger makes absolutely sense. And if you're developing in a node environment, chances are that you minify the output anyway.

Documentation

Another thing worth mentioning is that API functions are now documented on this webpage. There are still things missing like Typescript stuff (public interfaces and types) but I'll keep more attention to this from now on.

You can read about all changes in detail in the Changelog.

(*): The Web Audio API allows multiple connections from/to single audio nodes and it's ok to use this within plugins. However, connections between plugins are always one-to-one. This doesn't apply to the destination because it's not a plugin but the representation of a hardware device. It can have multiple audio endpoints wired to its input.